import java.sql.SQLOutput;
import java.util.Scanner;

public class code9_19 {
    //模拟实现字符串大写转小写
    public static String toLower(String str){
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < str.length(); i++) {
            char ch = str.charAt(i);
            if( ch>'A'&& ch<'Z'){
                sb.append((char)(ch+32));
            }else {
                sb.append(ch);
            }
        }
        return sb.toString();
    }
    public static void main(String[] args) {
        String str = "Hello Bit";
        System.out.println(toLower(str));
    }
    public static Boolean isEffect(char word){
        if(word >= 'a'&& word <= 'z'){
            return true;
        }else {
            return false;
        }
    }
    public static void main4(String[] args) {
        String str ="ah.aaa.a.??...//.aa.aha";
        String arr = str.toLowerCase();
        int right = str.length()-1;
        int left = 0;
        int sign = -1;
        while (left<right) {
            //获取左边的有效字母
            while (left < right && !isEffect(arr.charAt(left))) {
                left++;
            }
            //获取右边有效数字
            while (left < right && !isEffect(arr.charAt(right))) {
                right--;
            }
            if (arr.charAt(left) != arr.charAt(right)) {
                sign = 0;
                break;
            } else {
                left++;
                right--;

            }
        }
        if(sign == -1){
            System.out.println("是回文数");
        }else {
            System.out.println("不是回文数");
        }

    }
    public static void main3(String[] args) {
        String str = "k..hj.:j.jh..";
        int sign = -1;
        int len = str.length();
        char[] arr = str.toCharArray();
        for (int i = 0; i < len/2-1; i++) {
                if (arr[i]<'a'&&arr[i]>'z')
                {
                    continue;
                }else {
                    if(arr[i] == arr[len-1-i]){
                        continue;
                    }else {
                        sign = 0;
                        System.out.println("不是回文数");
                        break;
                    }
                }
        }
        if(sign == -1)
        {
            System.out.println("是回文数");
        }
    }
    public static void main2(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String str = scanner.nextLine();
        int index = -1;
        for (int i = str.length()-1; i >=0 ; i--) {
            if(str.charAt(i) == ' '){
                index = i;
                break;
            }
        }
        System.out.println(str.length()-1-index);
    }

    public static void main1(String[] args) {
        String s = "hello";
        char[] count = new char[26];
        for (int i = 0; i < s.length(); i++) {
            char c = s.charAt(i);
            count[c-97]++;
        }
        for (int i = 0; i < s.length(); i++) {
            char c = s.charAt(i);
            if (count[c - 97] == 1) {
                System.out.println(i);
                break;
            }
        }
    }
}
